<script type="text/javascript">
    $(document).ready(function() {
        var oTable = $('#table-view').dataTable({
            "sScrollY": "330px",
            "sScrollX": "150%",
            "sScrollXInner": "150%",
            "bScrollCollapse": false,
            "bPaginate": false,
            "bFilter": false,
            "bSort":false,
            "bInfo":false
        });
        new FixedColumns(oTable, {
            "iLeftColumns": 3
        });
    });
</script>
<div class="breadcrum">
    <p>
        <a href="{$config->site_url('laporan/asettetap/')}">Reporting</a><span></span>
        <a href="{$config->site_url('laporan/asettetap/')}">Aset Tetap dan Penyusutan</a><span></span>
        <small>Mesin dan Tower</small>
    </p>
    <div class="clear"></div>
</div>
<!--<div class="search-box">
    <h3><a href="#">Search</a></h3>
    <form method="post" action="#">
        <table width="100%" border="0" class="table-search">
            <tbody>
                <tr>
                    <th width="25%">Tahun</th>
                    <td width="35%">
                        <select name="status">
                            <option value=""></option>
                            <option selected="selected" value="2014">2014</option>
                            <option value="2013">2013</option>
                        </select>
                    </td>
                    <td  width="40%">
                        <input type="submit" value="Tampilkan" name="save" class="submit">
                        <input type="submit" value="Reset" name="save" class="submit">
                    </td>
                </tr>
            </tbody></table>
    </form>    
    <div class="clear"></div>
</div>-->
<div class="sub-content">
    <div class="table-info-box">
        <h3>MESIN & TOWER</h3>
        <table width="100%" class="table-info">
            <tbody> 

                <tr>
                    <th valign="top" width="30%">Metode penyusutan :</th>
                    <td width="70%">Garis lurus</td>  
                </tr> 
                <tr>
                    <th>Mesin dan Tower</th>
                    <td>8 Tahun</td> 
                </tr>
            </tbody>
        </table>
    </div>
    <div class="clear"></div>
    <div class="navigation"> 
        <div class="navigation-button">
            <ul>
                <li><a href="{$config->site_url('laporan/asettetap/print_mesin')}"><img alt="" src="{$BASEURL}/resource/doc/images/icon/printer-icon.png">Print Data</a></li> 
            </ul>
            <div class="clear"></div>
        </div>
    </div>
    <table width="100%" class="table-view" id="table-view">
        <thead>
            <tr>
                <th width="3%">No</th>
                <th width="15%">Keterangan</th>
                <th width="6%">No Inventaris</th>
                <th width="6%">Tanggal Perolehan</th>
                <th width="6%">Tanggal Berakhir</th>
                <th width="3%">Gol</th>
                <th width="6%">Umur Manfaat (bulan)</th>
                <th width="8%">Harga Perolehan Baru</th>
                <th width="6%">Tarif (%)</th>
                <th width="8%">Tarif Penyusutan per bulan</th>
                <th width="6%">Waktu penggunaan (bulan)</th>
                <th width="8%">Akm. Peny. 31-Des-{$last_year|default:''}</th>
                <th width="8%">Penyusutan Thn {$year|default:''}</th>
                <th width="8%">Akm. Peny. 31-Des-{$year|default:''}</th>
                <th width="8%">Nilai Buku 31-Des-{$year|default:''}</th>
            </tr>
        </thead>
                {if (!empty($rs_mesin))}
        <tr>
            <td></td>
            <td><b>Mesin dan Tower</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        {$nom = 1}
        {$harga_perolehan = 0}
        {$akm_last_year = 0}
        {$penyusutan_thn = 0}
        {$akm_year = 0}
        {$nilai_buku = 0}
        {foreach from=$rs_mesin item=result}
        <tr>
            <td align="center">{$nom++}</td>
            <td>{$result.barang_nama|default:''}</td>
            <td align="center">{$result.barang_noinventaris|default:''}</td>
            <td align="center">{$result.barang_tglbeli|date_format:"%d-%b-%Y"|default:''}</td>
            <td align="center">{$result.tgl_berakhir|date_format:"%d-%b-%Y"|default:''}</td>
            <td align="center"></td>
            <td align="center">{$result.umur_manfaat|default:''}</td>
            <td align="right">{$result.barang_harga_beli|number_format:0:',':'.'|default:''}</td>
            <td align="center">{$result.tarif|default:'0'} %</td>
            <td align="right">{$result.tarif_penyusutan|number_format:0:',':'.'|default:''}</td>
            <td align="center">{$result.waktu|default:''}</td>
            <td align="right">{$result.akm_last_year|number_format:0:',':'.'|default:''}</td>
            <td align="right">{$result.penyusutan_thn|number_format:0:',':'.'|default:''}</td>
            <td align="right">{($result.akm_last_year + $result.penyusutan_thn)|number_format:0:',':'.'|default:''}</td>
            <td align="right">{$result.barang_nilai_buku|number_format:0:',':'.'|default:''}</td>
            {$harga_perolehan = $harga_perolehan + $result.barang_harga_beli}
            {$akm_last_year = $akm_last_year + $result.akm_last_year}
            {$penyusutan_thn = $penyusutan_thn1 + $result.penyusutan_thn}
            {$akm_year = $akm_year + ($result.akm_last_year + $result.penyusutan_thn)}
            {$nilai_buku = $nilai_buku + $result.barang_nilai_buku}
        </tr>
        {/foreach}
        <tr>
            <td></td>
            <td><b>Jumlah Aset Mesin dan Tower</b></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td align="right"><b>{$harga_perolehan|number_format:0:',':'.'|default:''}</b></td>
            <td></td>
            <td></td>
            <td></td>
            <td align="right"><b>{$akm_last_year|number_format:0:',':'.'|default:''}</b></td>
            <td align="right"><b>{$penyusutan_thn|number_format:0:',':'.'|default:''}</b></td>
            <td align="right"><b>{$akm_year|number_format:0:',':'.'|default:''}</b></td>
            <td align="right"><b>{$nilai_buku|number_format:0:',':'.'|default:''}</b></td>
        </tr>
        {else}
        <tr>
            <td></td>
            <td>Belum ada data</td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
            <td></td>
        </tr>
        {/if}
    </table>
    <div class="clear"></div>
</div>